<template>
 <div>
    <el-menu
        active-text-color="#ffd04b"
        background-color="#545c64"
        class="el-menu-vertical-demo"
        default-active="/student/operate"
        :default-openeds="['/course','/student']"
        text-color="#fff"
        @open="handleOpen"
        @close="handleClose"
        router
      >
        <SubMenu :menuList = 'menuList'></SubMenu>
      </el-menu>
 </div>
</template>
<script setup lang='ts'>
import {useControlStore} from '../../pinia/loginController'
import SubMenu from './SubMenu.vue';
interface MenuList {link:string,name:string,title:string,children:MenuList[]}
const store2 = useControlStore();
const menuList:MenuList[] = store2.menuList


const handleOpen = (key: string, keyPath: string[]) => {
  console.log(key, keyPath)
}
const handleClose = (key: string, keyPath: string[]) => {
  console.log(key, keyPath)
}

</script>
<style scoped>
.el-menu {width:200px;height: 100vh;}
</style>